const http = require('http');

http.createServer().on("request", (req, res) => {

    console.log("接收请求")
    console.log("url:"+req.url)
    console.log("headers:"+JSON.stringify(req.headers))

    let d = [];
    req.addListener("data",chunk=>{
        d.push(chunk)
    })
    req.addListener("end", ()=>{
        console.log("接收完报文：")
        console.log(d.toString())
    })

    res.statusCode = 200
    res.end(JSON.stringify({name: 'ike'}));

}).listen(9000, "0.0.0.0");
